package com.example.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @RequestMapping("/hello")
    public String hello() {
        return "欢迎来到程序喵博客";
    }

    @GetMapping("/log")
    public String log() { ;

        logger.trace("Trace 日志");
        logger.debug("Debug 日志");
        logger.info("Info 日志");
        logger.warn("Warn 日志");
        logger.error("Error 日志");

        return "Test Log";
    }

}
